Telegram Group & Telegram Channel
Самый простой способ использовать модуль logging — вызывать функции напрямую, без создания объекта логгера:


import logging
logging.error('xxx')


Этот глобальный логгер можно настроить с помощью вызова logging.basicConfig():


import logging
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # -- xxx --


Однако у basicConfig есть свои ограничения. Во-первых, срабатывает только первый вызов — все последующие игнорируются. Во-вторых, любая функция, записывающая лог, может вызвать basicConfig, поэтому конфигурацию нужно задавать до любых сообщений:


import logging
logging.error('xxx') # ERROR:root:xxx
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # ERROR:root:xxx


👉@BookPython



tg-me.com/BookPython/3644
Create:
Last Update:

Самый простой способ использовать модуль logging — вызывать функции напрямую, без создания объекта логгера:


import logging
logging.error('xxx')


Этот глобальный логгер можно настроить с помощью вызова logging.basicConfig():


import logging
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # -- xxx --


Однако у basicConfig есть свои ограничения. Во-первых, срабатывает только первый вызов — все последующие игнорируются. Во-вторых, любая функция, записывающая лог, может вызвать basicConfig, поэтому конфигурацию нужно задавать до любых сообщений:


import logging
logging.error('xxx') # ERROR:root:xxx
logging.basicConfig(format='-- %(message)s --')
logging.error('xxx') # ERROR:root:xxx


👉@BookPython

BY Библиотека Python разработчика | Книги по питону


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/BookPython/3644

View MORE
Open in Telegram


Библиотека Python разработчика | Книги по питону Telegram | DID YOU KNOW?

Date: |

The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

Библиотека Python разработчика | Книги по питону from cn


Telegram Библиотека Python разработчика | Книги по питону
FROM USA